﻿using System;
using System.Text;

namespace yiracli
{
    public class Autorizacion
    {
        public readonly string basic64 = string.Empty;

        public Autorizacion (string usr, string pwd)
        {
            basic64 = dameAuthB64(usr, pwd);
        }

        public static string dameAuthB64 (string usr, string pwd)
        {
            string str = string.Format("{0}:{1}", usr, pwd);
            byte[] buff = Encoding.UTF8.GetBytes(str);
            return Convert.ToBase64String(buff);
        }
    }
}
